<div class="fly-panel fly-column">
  <div class="layui-container">
    <ul class="layui-clear">
      <li class="layui-hide-xs  layui-this">
        <a href="{:url('index/index/index')}">首页</a></li>
      {foreach $cates as $row}
      <li>
        <a href="{:url('index/index/index',['cid'=>$row['cid']])}">{$row.name}</a>
      </li>
      {/foreach}
    </ul>
    <div class="fly-column-right layui-hide-xs">
      <span class="fly-search">
        <i class="layui-icon"></i></span>
      <a href="{:url('index/jie/add')}" class="layui-btn">发表新帖</a></div>
    <div class="layui-hide-sm layui-show-xs-block" style="margin-top: -10px; padding-bottom: 10px; text-align: center;">
      <a href="/jie/add/" class="layui-btn">发表新帖</a></div>
  </div>
</div>
<div class="layui-container">
  <div class="layui-row layui-col-space15">
    <div class="layui-col-md8">
      <div class="fly-panel">
        <?php if ($top) { ?>
        
        <div class="fly-panel-title fly-filter">
          <a>置顶</a>
          <a href="#signin" class="layui-hide-sm layui-show-xs-block fly-right" id="LAY_goSignin" style="color: #FF5722;">去签到</a>
        </div>
        <?php } ?>
        <ul class="fly-list">
          {foreach $top as $row}
          <li>
            <a href="/u/7964544" class="fly-avatar">
              <img src="__ROOT__{$row.face}" alt="网购腐败女"></a>
            <h2>
              <a class="layui-badge">{$row.cname}</a>
              <a href="{:url('index/jie/index',['qid'=>$row['qid']])}">{$row.title}</a></h2>
            <div class="fly-list-info">
              <a href="/u/7964544" link="">
                <cite>{$row.nickname}</cite></a>
              <span>{:Ftime($row['ctime'])}</span>
              <span class="fly-list-kiss layui-hide-xs" title="悬赏飞吻">
                <i class="iconfont icon-kiss"></i>{$row.kiss}</span>
              <?php if($row['status']==1) { ?>
              <span class="layui-badge fly-badge-accept layui-hide-xs">已结</span>
              <?php } ?>
              <span class="fly-list-nums">
                <i class="iconfont icon-pinglun1" title="回答"></i>{$row.answer_num}</span>
            </div>
            <div class="fly-list-badge"></div>
          </li>
          {/foreach}
        </ul>
      </div>
      <div class="fly-panel" style="margin-bottom: 0;">
        <div class="fly-panel-title fly-filter">
          <a href="{:url('index/index/index',['cid'=>input('cid')])}" class="layui-this">综合</a>
          <span class="fly-mid"></span>
          <a href="{:url('index/index/index',['cid'=>input('cid'),'status'=>0])}">未结</a>
          <span class="fly-mid"></span>
          <a href="{:url('index/index/index',['cid'=>input('cid'),'status'=>1])}">已结</a>
          <span class="fly-mid"></span>
          <a href="{:url('index/index/index',['cid'=>input('cid'),'is_jing'=>1])}">精华</a></div>
        <ul class="fly-list">
          {foreach $ques as $row}
          <li>
            <a href="{:url('index/user/index',['uid'=>$row['uid'],'id'=>'78'])}" class="fly-avatar">
              <img src="__ROOT__{$row.face}" alt="网购腐败女"></a>
            <h2>
              <a class="layui-badge">{$row.cname}</a>
              <a href="{:url('index/jie/index',['qid'=>$row['qid']])}">{$row.title}</a></h2>
            <div class="fly-list-info">
              <a href="/u/7964544" link="">
                <cite>{$row.nickname}</cite></a>
              <span>{:Ftime($row['ctime'])}</span>
              <span class="fly-list-kiss layui-hide-xs" title="悬赏飞吻">
                <i class="iconfont icon-kiss"></i>{$row.kiss}</span>
              <?php if($row['status']==1) { ?>
              <span class="layui-badge fly-badge-accept layui-hide-xs">已结</span>
              <?php } ?>
              <span class="fly-list-nums">
                <i class="iconfont icon-pinglun1" title="回答"></i>{$row.answer_num}</span>
            </div>
            <div class="fly-list-badge">
              <?php if($row['is_jing']==1) { ?>
              <span class="layui-badge layui-bg-red">精帖</span>
              <?php } ?>

              <?php if($row['is_top']==1) { ?>
              <span class="layui-badge layui-bg-black">置顶</span>
              <?php } ?>
            </div>
          </li>
          {/foreach}

          <?php if(!$ques->total()){ ?>
          <ul class="jieda" id="jieda"> <li class="fly-none">消灭零帖子</li> </ul>
          <?php } ?>
        </ul>
        <style type="text/css">
            .pagination{

              height: 50px;
            }
            .pagination li{
              display: inline-block;
              padding: 5px 10px;
              border: 1px solid #009E94;
              margin-left: 5px;
              font-size: 16px;
            }
            .pagination li.active{
                background: #009E94;
                color: #fff;
            }

        </style>
        <div style="text-align: center">
          {$ques->render()}
         <!--  <div class="laypage-main">
             
            </div> -->
        </div>
      </div>
    </div>
    <div class="layui-col-md4">
      <?php if(!input()){ ?>
      <div class="fly-panel">
        <h3 class="fly-panel-title">温馨通道</h3>
        <ul class="fly-panel-main fly-list-static">
          <li>
            <a href="http://fly.layui.com/jie/4281/" target="_blank">layui 的 GitHub 及 Gitee (码云) 仓库，欢迎Star</a></li>
        </ul>
      </div>
      <div class="fly-panel fly-signin">
        <div class="fly-panel-title">签到
          <i class="fly-mid"></i>
          <a href="javascript:;" class="fly-link" id="LAY_signinHelp">说明</a>
          <i class="fly-mid"></i>
          <a href="javascript:;" class="fly-link" id="LAY_signinTop">活跃榜
            <span class="layui-badge-dot"></span></a>
          <span class="fly-signin-days"></span>
        </div>
        <div class="fly-panel-main fly-signin-main">
          <button class="layui-btn layui-btn-danger" id="LAY_signin">今日签到</button></div>
      </div>
      <div class="fly-panel">
        <div class="fly-panel-title">钻级赞助商
          <span class="fly-mid"></span>
          <a href="/jie/15697/" class="fly-link fly-joinad    ">我要加入</a></div>
        <div class="fly-panel-main" style="padding: 13px 15px;">
          <a href="/jie/15697/" target="_blank" rel="nofollow" class="fly-zanzhu" style="background-color: #393D49;">虚席以待</a></div>
      </div>
      <div class="fly-panel fly-rank fly-rank-reply" id="LAY_replyRank">
        <h3 class="fly-panel-title">回贴周榜</h3>
        <dl>
          <dd>
            <a href="/u/6064968">
              <img src="//q.qlogo.cn/qqapp/101235792/21F0961A7243DC371D026180CDF40095/100">
              <cite>用个名字真难</cite>
              <i>68次回答</i>
            </a>
          </dd>
        </dl>
      </div>
      <?php } ?>
      <dl class="fly-panel fly-list-one">
        <dt class="fly-panel-title">本周热议</dt>
        <dd>
          <a href="/jie/19520/">layui 2.2.3 发布，继续稳定</a>
          <span>
            <i class="iconfont icon-pinglun1"></i>65</span>
        </dd>
      </dl>
      <div class="fly-panel">
        <div class="fly-panel-title">官方产品</div>
        <div class="fly-panel-main">
          <a href="http://layim.layui.com/?from=fly" target="_blank" class="fly-zanzhu" time-limit="2017.09.25-2099.01.01" style="background-color: #5FB878;">LayIM 3.0 - layui 旗舰之作</a></div>
      </div>
      <div class="fly-panel" style="padding: 20px 0; text-align: center;">
        <img src="//cdn.layui.com/upload/2017_8/168_1501894831075_19619.jpg" style="max-width: 100%;" alt="layui">
        <p style="position: relative; color: #666;">微信扫码关注 layui 公众号</p></div>
      <div class="fly-panel fly-link">
        <h3 class="fly-panel-title">友情链接</h3>
        <dl class="fly-panel-main">
          <dd>
            <a href="http://layim.layui.com/" target="_blank">WebIM</a></dd>
          <dd></dd>
        </dl>
      </div>
    </div>
  </div>
</div>

<script type="text/javascript">

        layui.use(['form','jquery','layer'],function  () {
          var form = layui.form;
          $ = layui.jquery;
          var layer = layui.layer;


          $('.fly-search').click(function(event) {
              layer.open({
                type: 1,
                title: false,
                closeBtn: 0,
                shadeClose: true,
                area: ['550px'],
                skin: 'fly-layer-search',
                content: '<form  onSubmit="return checkSubmit(this)" ><input autocomplete="off" placeholder="搜索内容，回车跳转" type="text" name="q"></form>'
              });
          });
        })


        function checkSubmit (ev) {
            data = $(ev).find('input').val();
            url = "{:url('index/search/index')}";
            url = url.replace(".html",'')+'/q/'+data+".html";
            location.replace(url);
            return false;
        }

    </script>

